package com.boil.qz.safekavass.web.request.param;

import com.boil.util.Constants;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;

/**
 * Created by ChenYong on 2017-04-15.
 * <br>
 * 添加用户的请求参数。
 */
public class AddLoginUserParam {
    /**
     * 登录 ID
     */
    @NotBlank(message = "账号不能为空")
    @Pattern(regexp = Constants.ACCOUNT_RE, message = Constants.ACCOUNT_RE_MSG)
    private String loginid;
    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_50, message = "姓名的长度在1至50个字之间")
    private String loginName;
    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = Constants.PASSWD_RE, message = Constants.PASSWD_RE_MSG)
    private String passwd;
    /**
     * 煤矿编码
     */
    @Length(min = Constants.VALUE_0, max = Constants.VALUE_20, message = "煤矿编码的长度在0至20个字符之间")
    private String collieryNo;
    /**
     * 行业代码
     */
    @NotBlank(message = "行业代码不能为空")
    @Pattern(regexp = Constants.INDUSTRY_CODE_EMPTY_RE, message = Constants.INDUSTRY_CODE_RE_MSG)
    private String industryCode;
    /**
     * 用户类型
     */
    @Pattern(regexp = Constants.NUMBER_0_1_RE, message = ("用户类型" + Constants.NUMBER_0_1_RE_MSG))
    private String isAdmin;
    /**
     * 是否为领导
     */
    @Pattern(regexp = Constants.NUMBER_0_1_RE, message = ("是否为领导" + Constants.NUMBER_0_1_RE_MSG))
    private String isLeader;

    /**
     * 默认构造器。
     */
    public AddLoginUserParam() {
        super();
    }

    public String getLoginid() {
        return loginid;
    }

    public void setLoginid(String loginid) {
        this.loginid = loginid;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public String getCollieryNo() {
        return collieryNo;
    }

    public void setCollieryNo(String collieryNo) {
        this.collieryNo = collieryNo;
    }

    public String getIndustryCode() {
        return industryCode;
    }

    public void setIndustryCode(String industryCode) {
        this.industryCode = industryCode;
    }

    public String getIsAdmin() {
        return isAdmin;
    }

    public void setIsAdmin(String isAdmin) {
        this.isAdmin = isAdmin;
    }

    public String getIsLeader() {
        return isLeader;
    }

    public void setIsLeader(String isLeader) {
        this.isLeader = isLeader;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("AddLoginUserParam{");
        sb.append("loginid='").append(loginid).append('\'');
        sb.append(", loginName='").append(loginName).append('\'');
        sb.append(", passwd='").append(passwd).append('\'');
        sb.append(", collieryNo='").append(collieryNo).append('\'');
        sb.append(", industryCode='").append(industryCode).append('\'');
        sb.append(", isAdmin='").append(isAdmin).append('\'');
        sb.append(", isLeader='").append(isLeader).append('\'');
        sb.append('}');
        return sb.toString();
    }
}